\(\int \frac {(d+i c d x)^3 (a+b \arctan (c x))}{x^5} \, dx\) [28]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 103 \[ \int \frac {(d+i c d x)^3 (a+b \arctan (c x))}{x^5} \, dx=-\frac {b c d^3}{12 x^3}-\frac {i b c^2 d^3}{2 x^2}+\frac {7 b c^3 d^3}{4 x}-\frac {d^3 (1+i c x)^4 (a+b \arctan (c x))}{4 x^4}-2 i b c^4 d^3 \log (x)+2 i b c^4 d^3 \log (i+c x) \]

[Out]

-1/12*b*c*d^3/x^3-1/2*I*b*c^2*d^3/x^2+7/4*b*c^3*d^3/x-1/4*d^3*(1+I*c*x)^4*(a+b*arctan(c*x))/x^4-2*I*b*c^4*d^3*
ln(x)+2*I*b*c^4*d^3*ln(I+c*x)

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {37, 4992, 12, 90} \[ \int \frac {(d+i c d x)^3 (a+b \arctan (c x))}{x^5} \, dx=-\frac {d^3 (1+i c x)^4 (a+b \arctan (c x))}{4 x^4}-2 i b c^4 d^3 \log (x)+2 i b c^4 d^3 \log (c x+i)+\frac {7 b c^3 d^3}{4 x}-\frac {i b c^2 d^3}{2 x^2}-\frac {b c d^3}{12 x^3} \]

[In]

Int[((d + I*c*d*x)^3*(a + b*ArcTan[c*x]))/x^5,x]

[Out]

-1/12*(b*c*d^3)/x^3 - ((I/2)*b*c^2*d^3)/x^2 + (7*b*c^3*d^3)/(4*x) - (d^3*(1 + I*c*x)^4*(a + b*ArcTan[c*x]))/(4
*x^4) - (2*I)*b*c^4*d^3*Log[x] + (2*I)*b*c^4*d^3*Log[I + c*x]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 37

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^(n +
1)/((b*c - a*d)*(m + 1))), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[m + n + 2, 0] && NeQ
[m, -1]

Rule 90

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rule 4992

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((f_.)*(x_))^(m_.)*((d_.) + (e_.)*(x_))^(q_.), x_Symbol] :> With[{u = I
ntHide[(f*x)^m*(d + e*x)^q, x]}, Dist[a + b*ArcTan[c*x], u, x] - Dist[b*c, Int[SimplifyIntegrand[u/(1 + c^2*x^
2), x], x], x]] /; FreeQ[{a, b, c, d, e, f, q}, x] && NeQ[q, -1] && IntegerQ[2*m] && ((IGtQ[m, 0] && IGtQ[q, 0
]) || (ILtQ[m + q + 1, 0] && LtQ[m*q, 0]))

Rubi steps \begin{align*} \text {integral}& = -\frac {d^3 (1+i c x)^4 (a+b \arctan (c x))}{4 x^4}-(b c) \int \frac {d^3 (i-c x)^3}{4 x^4 (i+c x)} \, dx \\ & = -\frac {d^3 (1+i c x)^4 (a+b \arctan (c x))}{4 x^4}-\frac {1}{4} \left (b c d^3\right ) \int \frac {(i-c x)^3}{x^4 (i+c x)} \, dx \\ & = -\frac {d^3 (1+i c x)^4 (a+b \arctan (c x))}{4 x^4}-\frac {1}{4} \left (b c d^3\right ) \int \left (-\frac {1}{x^4}-\frac {4 i c}{x^3}+\frac {7 c^2}{x^2}+\frac {8 i c^3}{x}-\frac {8 i c^4}{i+c x}\right ) \, dx \\ & = -\frac {b c d^3}{12 x^3}-\frac {i b c^2 d^3}{2 x^2}+\frac {7 b c^3 d^3}{4 x}-\frac {d^3 (1+i c x)^4 (a+b \arctan (c x))}{4 x^4}-2 i b c^4 d^3 \log (x)+2 i b c^4 d^3 \log (i+c x) \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.10 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.60 \[ \int \frac {(d+i c d x)^3 (a+b \arctan (c x))}{x^5} \, dx=\frac {d^3 \left (-b c x \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},1,-\frac {1}{2},-c^2 x^2\right )-3 i \left (-i a+4 a c x+6 i a c^2 x^2+2 b c^2 x^2-4 a c^3 x^3+b \left (-i+4 c x+6 i c^2 x^2-4 c^3 x^3\right ) \arctan (c x)+6 i b c^3 x^3 \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},-c^2 x^2\right )+8 b c^4 x^4 \log (x)-4 b c^4 x^4 \log \left (1+c^2 x^2\right )\right )\right )}{12 x^4} \]

[In]

Integrate[((d + I*c*d*x)^3*(a + b*ArcTan[c*x]))/x^5,x]

[Out]

(d^3*(-(b*c*x*Hypergeometric2F1[-3/2, 1, -1/2, -(c^2*x^2)]) - (3*I)*((-I)*a + 4*a*c*x + (6*I)*a*c^2*x^2 + 2*b*
c^2*x^2 - 4*a*c^3*x^3 + b*(-I + 4*c*x + (6*I)*c^2*x^2 - 4*c^3*x^3)*ArcTan[c*x] + (6*I)*b*c^3*x^3*Hypergeometri
c2F1[-1/2, 1, 1/2, -(c^2*x^2)] + 8*b*c^4*x^4*Log[x] - 4*b*c^4*x^4*Log[1 + c^2*x^2])))/(12*x^4)

Maple [A] (verified)

Time = 1.32 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.43

method result size
parts \(a \,d^{3} \left (\frac {3 c^{2}}{2 x^{2}}-\frac {1}{4 x^{4}}+\frac {i c^{3}}{x}-\frac {i c}{x^{3}}\right )+b \,d^{3} c^{4} \left (-\frac {\arctan \left (c x \right )}{4 c^{4} x^{4}}-\frac {i \arctan \left (c x \right )}{c^{3} x^{3}}+\frac {i \arctan \left (c x \right )}{c x}+\frac {3 \arctan \left (c x \right )}{2 c^{2} x^{2}}-\frac {i}{2 c^{2} x^{2}}-2 i \ln \left (c x \right )-\frac {1}{12 c^{3} x^{3}}+\frac {7}{4 c x}+i \ln \left (c^{2} x^{2}+1\right )+\frac {7 \arctan \left (c x \right )}{4}\right )\) \(147\)
derivativedivides \(c^{4} \left (a \,d^{3} \left (-\frac {1}{4 c^{4} x^{4}}-\frac {i}{c^{3} x^{3}}+\frac {i}{c x}+\frac {3}{2 c^{2} x^{2}}\right )+b \,d^{3} \left (-\frac {\arctan \left (c x \right )}{4 c^{4} x^{4}}-\frac {i \arctan \left (c x \right )}{c^{3} x^{3}}+\frac {i \arctan \left (c x \right )}{c x}+\frac {3 \arctan \left (c x \right )}{2 c^{2} x^{2}}-\frac {i}{2 c^{2} x^{2}}-2 i \ln \left (c x \right )-\frac {1}{12 c^{3} x^{3}}+\frac {7}{4 c x}+i \ln \left (c^{2} x^{2}+1\right )+\frac {7 \arctan \left (c x \right )}{4}\right )\right )\) \(153\)
default \(c^{4} \left (a \,d^{3} \left (-\frac {1}{4 c^{4} x^{4}}-\frac {i}{c^{3} x^{3}}+\frac {i}{c x}+\frac {3}{2 c^{2} x^{2}}\right )+b \,d^{3} \left (-\frac {\arctan \left (c x \right )}{4 c^{4} x^{4}}-\frac {i \arctan \left (c x \right )}{c^{3} x^{3}}+\frac {i \arctan \left (c x \right )}{c x}+\frac {3 \arctan \left (c x \right )}{2 c^{2} x^{2}}-\frac {i}{2 c^{2} x^{2}}-2 i \ln \left (c x \right )-\frac {1}{12 c^{3} x^{3}}+\frac {7}{4 c x}+i \ln \left (c^{2} x^{2}+1\right )+\frac {7 \arctan \left (c x \right )}{4}\right )\right )\) \(153\)
parallelrisch \(\frac {-12 i x \arctan \left (c x \right ) b c \,d^{3}+12 i x^{3} a \,c^{3} d^{3}-6 i x^{2} b \,c^{2} d^{3}+21 x^{4} \arctan \left (c x \right ) b \,c^{4} d^{3}-12 i a c \,d^{3} x -18 a \,c^{4} d^{3} x^{4}+12 i x^{3} \arctan \left (c x \right ) b \,c^{3} d^{3}+21 b \,c^{3} d^{3} x^{3}+6 i x^{4} b \,c^{4} d^{3}+18 x^{2} \arctan \left (c x \right ) b \,c^{2} d^{3}-24 i c^{4} b \,d^{3} \ln \left (x \right ) x^{4}+18 x^{2} d^{3} c^{2} a +12 i c^{4} b \,d^{3} \ln \left (c^{2} x^{2}+1\right ) x^{4}-b c \,d^{3} x -3 b \,d^{3} \arctan \left (c x \right )-3 a \,d^{3}}{12 x^{4}}\) \(215\)
risch \(\frac {\left (4 b \,c^{3} d^{3} x^{3}-6 i x^{2} b \,c^{2} d^{3}-4 b c \,d^{3} x +i b \,d^{3}\right ) \ln \left (i c x +1\right )}{8 x^{4}}-\frac {i d^{3} \left (-3 b \,c^{4} \ln \left (119 c x -119 i\right ) x^{4}-45 b \,c^{4} \ln \left (-217 c x -217 i\right ) x^{4}+48 b \,c^{4} \ln \left (-527 c x \right ) x^{4}-24 a \,c^{3} x^{3}-12 i b \,c^{3} x^{3} \ln \left (-i c x +1\right )-18 x^{2} b \ln \left (-i c x +1\right ) c^{2}+42 i b \,c^{3} x^{3}+12 b \,c^{2} x^{2}+36 i a \,c^{2} x^{2}+24 c x a +12 i b c x \ln \left (-i c x +1\right )+3 b \ln \left (-i c x +1\right )-2 i b c x -6 i a \right )}{24 x^{4}}\) \(227\)

[In]

int((d+I*c*d*x)^3*(a+b*arctan(c*x))/x^5,x,method=_RETURNVERBOSE)

[Out]

a*d^3*(3/2*c^2/x^2-1/4/x^4+I*c^3/x-I*c/x^3)+b*d^3*c^4*(-1/4*arctan(c*x)/c^4/x^4-I*arctan(c*x)/c^3/x^3+I*arctan
(c*x)/c/x+3/2/c^2/x^2*arctan(c*x)-1/2*I/c^2/x^2-2*I*ln(c*x)-1/12/c^3/x^3+7/4/c/x+I*ln(c^2*x^2+1)+7/4*arctan(c*
x))

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 174 vs. \(2 (85) = 170\).

Time = 0.25 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.69 \[ \int \frac {(d+i c d x)^3 (a+b \arctan (c x))}{x^5} \, dx=\frac {-48 i \, b c^{4} d^{3} x^{4} \log \left (x\right ) + 45 i \, b c^{4} d^{3} x^{4} \log \left (\frac {c x + i}{c}\right ) + 3 i \, b c^{4} d^{3} x^{4} \log \left (\frac {c x - i}{c}\right ) - 6 \, {\left (-4 i \, a - 7 \, b\right )} c^{3} d^{3} x^{3} + 12 \, {\left (3 \, a - i \, b\right )} c^{2} d^{3} x^{2} - 2 \, {\left (12 i \, a + b\right )} c d^{3} x - 6 \, a d^{3} - 3 \, {\left (4 \, b c^{3} d^{3} x^{3} - 6 i \, b c^{2} d^{3} x^{2} - 4 \, b c d^{3} x + i \, b d^{3}\right )} \log \left (-\frac {c x + i}{c x - i}\right )}{24 \, x^{4}} \]

[In]

integrate((d+I*c*d*x)^3*(a+b*arctan(c*x))/x^5,x, algorithm="fricas")

[Out]

1/24*(-48*I*b*c^4*d^3*x^4*log(x) + 45*I*b*c^4*d^3*x^4*log((c*x + I)/c) + 3*I*b*c^4*d^3*x^4*log((c*x - I)/c) -
6*(-4*I*a - 7*b)*c^3*d^3*x^3 + 12*(3*a - I*b)*c^2*d^3*x^2 - 2*(12*I*a + b)*c*d^3*x - 6*a*d^3 - 3*(4*b*c^3*d^3*
x^3 - 6*I*b*c^2*d^3*x^2 - 4*b*c*d^3*x + I*b*d^3)*log(-(c*x + I)/(c*x - I)))/x^4

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 311 vs. \(2 (99) = 198\).

Time = 14.11 (sec) , antiderivative size = 311, normalized size of antiderivative = 3.02 \[ \int \frac {(d+i c d x)^3 (a+b \arctan (c x))}{x^5} \, dx=- 2 i b c^{4} d^{3} \log {\left (3689 b^{2} c^{9} d^{6} x \right )} + \frac {i b c^{4} d^{3} \log {\left (3689 b^{2} c^{9} d^{6} x - 3689 i b^{2} c^{8} d^{6} \right )}}{8} + \frac {15 i b c^{4} d^{3} \log {\left (3689 b^{2} c^{9} d^{6} x + 3689 i b^{2} c^{8} d^{6} \right )}}{8} - \frac {3 a d^{3} + x^{3} \left (- 12 i a c^{3} d^{3} - 21 b c^{3} d^{3}\right ) + x^{2} \left (- 18 a c^{2} d^{3} + 6 i b c^{2} d^{3}\right ) + x \left (12 i a c d^{3} + b c d^{3}\right )}{12 x^{4}} + \frac {\left (- 4 b c^{3} d^{3} x^{3} + 6 i b c^{2} d^{3} x^{2} + 4 b c d^{3} x - i b d^{3}\right ) \log {\left (- i c x + 1 \right )}}{8 x^{4}} + \frac {\left (4 b c^{3} d^{3} x^{3} - 6 i b c^{2} d^{3} x^{2} - 4 b c d^{3} x + i b d^{3}\right ) \log {\left (i c x + 1 \right )}}{8 x^{4}} \]

[In]

integrate((d+I*c*d*x)**3*(a+b*atan(c*x))/x**5,x)

[Out]

-2*I*b*c**4*d**3*log(3689*b**2*c**9*d**6*x) + I*b*c**4*d**3*log(3689*b**2*c**9*d**6*x - 3689*I*b**2*c**8*d**6)
/8 + 15*I*b*c**4*d**3*log(3689*b**2*c**9*d**6*x + 3689*I*b**2*c**8*d**6)/8 - (3*a*d**3 + x**3*(-12*I*a*c**3*d*
*3 - 21*b*c**3*d**3) + x**2*(-18*a*c**2*d**3 + 6*I*b*c**2*d**3) + x*(12*I*a*c*d**3 + b*c*d**3))/(12*x**4) + (-
4*b*c**3*d**3*x**3 + 6*I*b*c**2*d**3*x**2 + 4*b*c*d**3*x - I*b*d**3)*log(-I*c*x + 1)/(8*x**4) + (4*b*c**3*d**3
*x**3 - 6*I*b*c**2*d**3*x**2 - 4*b*c*d**3*x + I*b*d**3)*log(I*c*x + 1)/(8*x**4)

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 202 vs. \(2 (85) = 170\).

Time = 0.28 (sec) , antiderivative size = 202, normalized size of antiderivative = 1.96 \[ \int \frac {(d+i c d x)^3 (a+b \arctan (c x))}{x^5} \, dx=\frac {1}{2} i \, {\left (c {\left (\log \left (c^{2} x^{2} + 1\right ) - \log \left (x^{2}\right )\right )} + \frac {2 \, \arctan \left (c x\right )}{x}\right )} b c^{3} d^{3} + \frac {3}{2} \, {\left ({\left (c \arctan \left (c x\right ) + \frac {1}{x}\right )} c + \frac {\arctan \left (c x\right )}{x^{2}}\right )} b c^{2} d^{3} + \frac {1}{2} i \, {\left ({\left (c^{2} \log \left (c^{2} x^{2} + 1\right ) - c^{2} \log \left (x^{2}\right ) - \frac {1}{x^{2}}\right )} c - \frac {2 \, \arctan \left (c x\right )}{x^{3}}\right )} b c d^{3} + \frac {i \, a c^{3} d^{3}}{x} + \frac {1}{12} \, {\left ({\left (3 \, c^{3} \arctan \left (c x\right ) + \frac {3 \, c^{2} x^{2} - 1}{x^{3}}\right )} c - \frac {3 \, \arctan \left (c x\right )}{x^{4}}\right )} b d^{3} + \frac {3 \, a c^{2} d^{3}}{2 \, x^{2}} - \frac {i \, a c d^{3}}{x^{3}} - \frac {a d^{3}}{4 \, x^{4}} \]

[In]

integrate((d+I*c*d*x)^3*(a+b*arctan(c*x))/x^5,x, algorithm="maxima")

[Out]

1/2*I*(c*(log(c^2*x^2 + 1) - log(x^2)) + 2*arctan(c*x)/x)*b*c^3*d^3 + 3/2*((c*arctan(c*x) + 1/x)*c + arctan(c*
x)/x^2)*b*c^2*d^3 + 1/2*I*((c^2*log(c^2*x^2 + 1) - c^2*log(x^2) - 1/x^2)*c - 2*arctan(c*x)/x^3)*b*c*d^3 + I*a*
c^3*d^3/x + 1/12*((3*c^3*arctan(c*x) + (3*c^2*x^2 - 1)/x^3)*c - 3*arctan(c*x)/x^4)*b*d^3 + 3/2*a*c^2*d^3/x^2 -
 I*a*c*d^3/x^3 - 1/4*a*d^3/x^4

Giac [F]

\[ \int \frac {(d+i c d x)^3 (a+b \arctan (c x))}{x^5} \, dx=\int { \frac {{\left (i \, c d x + d\right )}^{3} {\left (b \arctan \left (c x\right ) + a\right )}}{x^{5}} \,d x } \]

[In]

integrate((d+I*c*d*x)^3*(a+b*arctan(c*x))/x^5,x, algorithm="giac")

[Out]

sage0*x

Mupad [B] (verification not implemented)

Time = 0.75 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.50 \[ \int \frac {(d+i c d x)^3 (a+b \arctan (c x))}{x^5} \, dx=-\frac {\frac {d^3\,\left (3\,a+3\,b\,\mathrm {atan}\left (c\,x\right )\right )}{12}+\frac {d^3\,x\,\left (a\,c\,12{}\mathrm {i}+b\,c+b\,c\,\mathrm {atan}\left (c\,x\right )\,12{}\mathrm {i}\right )}{12}-\frac {d^3\,x^2\,\left (18\,a\,c^2+18\,b\,c^2\,\mathrm {atan}\left (c\,x\right )-b\,c^2\,6{}\mathrm {i}\right )}{12}-\frac {d^3\,x^3\,\left (a\,c^3\,12{}\mathrm {i}+21\,b\,c^3+b\,c^3\,\mathrm {atan}\left (c\,x\right )\,12{}\mathrm {i}\right )}{12}}{x^4}+\frac {d^3\,\left (21\,b\,c^4\,\mathrm {atan}\left (c\,x\right )+b\,c^4\,\ln \left (c^2\,x^2+1\right )\,12{}\mathrm {i}-b\,c^4\,\ln \left (x\right )\,24{}\mathrm {i}\right )}{12} \]

[In]

int(((a + b*atan(c*x))*(d + c*d*x*1i)^3)/x^5,x)

[Out]

(d^3*(21*b*c^4*atan(c*x) + b*c^4*log(c^2*x^2 + 1)*12i - b*c^4*log(x)*24i))/12 - ((d^3*(3*a + 3*b*atan(c*x)))/1
2 + (d^3*x*(a*c*12i + b*c + b*c*atan(c*x)*12i))/12 - (d^3*x^2*(18*a*c^2 - b*c^2*6i + 18*b*c^2*atan(c*x)))/12 -
 (d^3*x^3*(a*c^3*12i + 21*b*c^3 + b*c^3*atan(c*x)*12i))/12)/x^4